package com.itheima.entity;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

public class BRCYDEMO {
    public static void main(String[] args) {
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        String encode1 = bCryptPasswordEncoder.encode("123");
        String encode2 = bCryptPasswordEncoder.encode("123");
        System.out.println(encode1);
        System.out.println(encode2);

        //使用明文密码和加密后的密码进行匹配
        System.out.println(bCryptPasswordEncoder.matches("1234",encode2));
        System.out.println(bCryptPasswordEncoder.matches("1234",encode1));
    }

}
